/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model.impl;

import com.crossriver.crgis.database.model.Bank_Payment_Slip;
import com.crossriver.crgis.database.model.Bank_Payment_SlipModel;
import com.crossriver.crgis.database.model.Bank_Payment_SlipSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The base model implementation for the Bank_Payment_Slip service. Represents a row in the &quot;CRGIA_Bank_Payment_Slip&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.crossriver.crgis.database.model.Bank_Payment_SlipModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link Bank_Payment_SlipImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a bank_ payment_ slip model instance should use the {@link com.crossriver.crgis.database.model.Bank_Payment_Slip} interface instead.
 * </p>
 *
 * @author Wole Adetiba
 * @see Bank_Payment_SlipImpl
 * @see com.crossriver.crgis.database.model.Bank_Payment_Slip
 * @see com.crossriver.crgis.database.model.Bank_Payment_SlipModel
 * @generated
 */
public class Bank_Payment_SlipModelImpl extends BaseModelImpl<Bank_Payment_Slip>
	implements Bank_Payment_SlipModel {
	public static final String TABLE_NAME = "CRGIA_Bank_Payment_Slip";
	public static final Object[][] TABLE_COLUMNS = {
			{ "depSlipNo", new Integer(Types.VARCHAR) },
			{ "userId", new Integer(Types.VARCHAR) },
			{ "registedDate", new Integer(Types.TIMESTAMP) },
			{ "applicationId", new Integer(Types.VARCHAR) },
			{ "depositorName", new Integer(Types.VARCHAR) },
			{ "paidAmount", new Integer(Types.DOUBLE) },
			{ "approvedAmount", new Integer(Types.DOUBLE) },
			{ "bankName", new Integer(Types.VARCHAR) },
			{ "uploadDepositSlip", new Integer(Types.VARCHAR) },
			{ "uploadDepositSlipFilename", new Integer(Types.VARCHAR) },
			{ "uploadDepositSlipDocName", new Integer(Types.VARCHAR) },
			{ "status", new Integer(Types.VARCHAR) }
		};
	public static final String TABLE_SQL_CREATE = "create table CRGIA_Bank_Payment_Slip (depSlipNo VARCHAR(75) not null primary key,userId VARCHAR(75) null,registedDate DATE null,applicationId VARCHAR(75) null,depositorName VARCHAR(75) null,paidAmount DOUBLE,approvedAmount DOUBLE,bankName VARCHAR(75) null,uploadDepositSlip VARCHAR(75) null,uploadDepositSlipFilename VARCHAR(75) null,uploadDepositSlipDocName VARCHAR(75) null,status VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table CRGIA_Bank_Payment_Slip";
	public static final String ORDER_BY_JPQL = " ORDER BY bank_Payment_Slip.depSlipNo ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CRGIA_Bank_Payment_Slip.depSlipNo ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.crossriver.crgis.database.model.Bank_Payment_Slip"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.crossriver.crgis.database.model.Bank_Payment_Slip"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Bank_Payment_Slip toModel(Bank_Payment_SlipSoap soapModel) {
		Bank_Payment_Slip model = new Bank_Payment_SlipImpl();

		model.setDepSlipNo(soapModel.getDepSlipNo());
		model.setUserId(soapModel.getUserId());
		model.setRegistedDate(soapModel.getRegistedDate());
		model.setApplicationId(soapModel.getApplicationId());
		model.setDepositorName(soapModel.getDepositorName());
		model.setPaidAmount(soapModel.getPaidAmount());
		model.setApprovedAmount(soapModel.getApprovedAmount());
		model.setBankName(soapModel.getBankName());
		model.setUploadDepositSlip(soapModel.getUploadDepositSlip());
		model.setUploadDepositSlipFilename(soapModel.getUploadDepositSlipFilename());
		model.setUploadDepositSlipDocName(soapModel.getUploadDepositSlipDocName());
		model.setStatus(soapModel.getStatus());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Bank_Payment_Slip> toModels(
		Bank_Payment_SlipSoap[] soapModels) {
		List<Bank_Payment_Slip> models = new ArrayList<Bank_Payment_Slip>(soapModels.length);

		for (Bank_Payment_SlipSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.crossriver.crgis.database.model.Bank_Payment_Slip"));

	public Bank_Payment_SlipModelImpl() {
	}

	public String getPrimaryKey() {
		return _depSlipNo;
	}

	public void setPrimaryKey(String pk) {
		setDepSlipNo(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _depSlipNo;
	}

	public String getDepSlipNo() {
		if (_depSlipNo == null) {
			return StringPool.BLANK;
		}
		else {
			return _depSlipNo;
		}
	}

	public void setDepSlipNo(String depSlipNo) {
		_depSlipNo = depSlipNo;
	}

	public String getUserId() {
		if (_userId == null) {
			return StringPool.BLANK;
		}
		else {
			return _userId;
		}
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public Date getRegistedDate() {
		return _registedDate;
	}

	public void setRegistedDate(Date registedDate) {
		_registedDate = registedDate;
	}

	public String getApplicationId() {
		if (_applicationId == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationId;
		}
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getDepositorName() {
		if (_depositorName == null) {
			return StringPool.BLANK;
		}
		else {
			return _depositorName;
		}
	}

	public void setDepositorName(String depositorName) {
		_depositorName = depositorName;
	}

	public Double getPaidAmount() {
		return _paidAmount;
	}

	public void setPaidAmount(Double paidAmount) {
		_paidAmount = paidAmount;
	}

	public Double getApprovedAmount() {
		return _approvedAmount;
	}

	public void setApprovedAmount(Double approvedAmount) {
		_approvedAmount = approvedAmount;
	}

	public String getBankName() {
		if (_bankName == null) {
			return StringPool.BLANK;
		}
		else {
			return _bankName;
		}
	}

	public void setBankName(String bankName) {
		_bankName = bankName;
	}

	public String getUploadDepositSlip() {
		if (_uploadDepositSlip == null) {
			return StringPool.BLANK;
		}
		else {
			return _uploadDepositSlip;
		}
	}

	public void setUploadDepositSlip(String uploadDepositSlip) {
		_uploadDepositSlip = uploadDepositSlip;
	}

	public String getUploadDepositSlipFilename() {
		if (_uploadDepositSlipFilename == null) {
			return StringPool.BLANK;
		}
		else {
			return _uploadDepositSlipFilename;
		}
	}

	public void setUploadDepositSlipFilename(String uploadDepositSlipFilename) {
		_uploadDepositSlipFilename = uploadDepositSlipFilename;
	}

	public String getUploadDepositSlipDocName() {
		if (_uploadDepositSlipDocName == null) {
			return StringPool.BLANK;
		}
		else {
			return _uploadDepositSlipDocName;
		}
	}

	public void setUploadDepositSlipDocName(String uploadDepositSlipDocName) {
		_uploadDepositSlipDocName = uploadDepositSlipDocName;
	}

	public String getStatus() {
		if (_status == null) {
			return StringPool.BLANK;
		}
		else {
			return _status;
		}
	}

	public void setStatus(String status) {
		_status = status;
	}

	public Bank_Payment_Slip toEscapedModel() {
		if (isEscapedModel()) {
			return (Bank_Payment_Slip)this;
		}
		else {
			return (Bank_Payment_Slip)Proxy.newProxyInstance(Bank_Payment_Slip.class.getClassLoader(),
				new Class[] { Bank_Payment_Slip.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Bank_Payment_SlipImpl bank_Payment_SlipImpl = new Bank_Payment_SlipImpl();

		bank_Payment_SlipImpl.setDepSlipNo(getDepSlipNo());

		bank_Payment_SlipImpl.setUserId(getUserId());

		bank_Payment_SlipImpl.setRegistedDate(getRegistedDate());

		bank_Payment_SlipImpl.setApplicationId(getApplicationId());

		bank_Payment_SlipImpl.setDepositorName(getDepositorName());

		bank_Payment_SlipImpl.setPaidAmount(getPaidAmount());

		bank_Payment_SlipImpl.setApprovedAmount(getApprovedAmount());

		bank_Payment_SlipImpl.setBankName(getBankName());

		bank_Payment_SlipImpl.setUploadDepositSlip(getUploadDepositSlip());

		bank_Payment_SlipImpl.setUploadDepositSlipFilename(getUploadDepositSlipFilename());

		bank_Payment_SlipImpl.setUploadDepositSlipDocName(getUploadDepositSlipDocName());

		bank_Payment_SlipImpl.setStatus(getStatus());

		return bank_Payment_SlipImpl;
	}

	public int compareTo(Bank_Payment_Slip bank_Payment_Slip) {
		int value = 0;

		value = getDepSlipNo().compareTo(bank_Payment_Slip.getDepSlipNo());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Bank_Payment_Slip bank_Payment_Slip = null;

		try {
			bank_Payment_Slip = (Bank_Payment_Slip)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = bank_Payment_Slip.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(25);

		sb.append("{depSlipNo=");
		sb.append(getDepSlipNo());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", registedDate=");
		sb.append(getRegistedDate());
		sb.append(", applicationId=");
		sb.append(getApplicationId());
		sb.append(", depositorName=");
		sb.append(getDepositorName());
		sb.append(", paidAmount=");
		sb.append(getPaidAmount());
		sb.append(", approvedAmount=");
		sb.append(getApprovedAmount());
		sb.append(", bankName=");
		sb.append(getBankName());
		sb.append(", uploadDepositSlip=");
		sb.append(getUploadDepositSlip());
		sb.append(", uploadDepositSlipFilename=");
		sb.append(getUploadDepositSlipFilename());
		sb.append(", uploadDepositSlipDocName=");
		sb.append(getUploadDepositSlipDocName());
		sb.append(", status=");
		sb.append(getStatus());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(40);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Bank_Payment_Slip");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>depSlipNo</column-name><column-value><![CDATA[");
		sb.append(getDepSlipNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>registedDate</column-name><column-value><![CDATA[");
		sb.append(getRegistedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>depositorName</column-name><column-value><![CDATA[");
		sb.append(getDepositorName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>paidAmount</column-name><column-value><![CDATA[");
		sb.append(getPaidAmount());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>approvedAmount</column-name><column-value><![CDATA[");
		sb.append(getApprovedAmount());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>bankName</column-name><column-value><![CDATA[");
		sb.append(getBankName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>uploadDepositSlip</column-name><column-value><![CDATA[");
		sb.append(getUploadDepositSlip());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>uploadDepositSlipFilename</column-name><column-value><![CDATA[");
		sb.append(getUploadDepositSlipFilename());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>uploadDepositSlipDocName</column-name><column-value><![CDATA[");
		sb.append(getUploadDepositSlipDocName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>status</column-name><column-value><![CDATA[");
		sb.append(getStatus());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _depSlipNo;
	private String _userId;
	private Date _registedDate;
	private String _applicationId;
	private String _depositorName;
	private Double _paidAmount;
	private Double _approvedAmount;
	private String _bankName;
	private String _uploadDepositSlip;
	private String _uploadDepositSlipFilename;
	private String _uploadDepositSlipDocName;
	private String _status;
}